<template>
  <el-dialog
    title="返利说明标准格式"
    :close-on-click-modal="false"
    :visible.sync="isVisible"
    width="27%"
    @close="closeDialog"
    center
  >
    <p>返利金额仅限单日累积，不能多日累积！</p>
    <span>*必有（备注周卡月卡等是否算入）</span>
    <p>注：返利货币为元宝</p>
    <span>*返利货币请自行调整</span>
    <p>（次日自动返利，无需申请）</p>
    <span>*如手动返利此行删除，自动返利填写返利时间</span>
    <p>★100-499元返100%</p>
    <p>★500-999元返150%</p>
    <p>★1000-2999元返200%</p>
    <p>★3000-4999元返250%</p>
    <p>★5000元及以上返300%</p>
    <span>*只更改金额及比例</span>
    <span slot="footer" class="dialog-footer">
      <el-button type="primary" @click="onCopy">复制</el-button>
    </span>
  </el-dialog>
</template>
<script>
export default {
  data() {
    return {
      isVisible: this.isShow,
    };
  },
  props: {
    isShow: Boolean,
  },
  methods: {
    closeDialog() {
      this.$emit("closeDialog");
    },
    onCopy() {
      var str =
        "返利金额仅限单日累积，不能多日累积！n注：返利货币为元宝n★100-499元返100%n★500-999元返150%n★1000-2999元返200%n★3000-4999元返250%n★5000元及以上返300%";
      str = str.replace(/n/g, "\n");
      this.$copyText(str).then(
        (e) => {
          this.$message({
            message: "复制成功",
            type: "success",
          });
        },
        function (e) {}
      );
      this.isVisible = false;
    },
  },
};
</script>
<style lang="scss" scoped>
.el-dialog__body p {
  line-height: 30px;
}
.el-dialog__body span {
  color: #f00;
}
</style>